<template>
  <div>
    <div>
      <el-input
        placeholder="请输入内容"
        v-model="inpunt"
        class="elinput"
        clearable
        @change="select()"
      >
      </el-input>

      <el-button type="primary" @click="select()" class="elinput_btn"
        >查询</el-button
      >
      <!-- <el-button type="primary" @click="dialogVisible = true">新增</el-button> -->
    </div>
    <template>
      <!--  -->
      <!-- <el-table-column
      type="selection"
      width="55">
    </el-table-column> -->
      <el-table :data="date" border size="50" style="width: 100%">
        <!-- sortable 是排序 -->
        <el-table-column prop="uid" sortable label="#" width="200"> </el-table-column>
        <!--  -->
        <el-table-column
        sortable
          prop="uname"
          label="用户名"
          size="50"
          min-width="200"
          height="200"
        >
        </el-table-column>
        <el-table-column
        sortable
          prop="pwd"
          label="密码"
          size="50"
          min-width="200"
          height="200"
        >
        </el-table-column>
        <el-table-column
        sortable
          prop="phone"
          label="手机号"
          size="50"
          min-width="200"
          height="200"
        >
        </el-table-column>
        <!-- <el-table-column label="操作" width="150">
          <template slot-scope="scope">
            <el-button type="primary" size="small" @click="updataLB(scope.row)"
              >编辑</el-button
            >

            
            <el-popconfirm title="这是一段内容确定删除吗？" @confirm="deleteLBsend()">
              <el-button slot="reference" type="danger" size="small" @click="deleteLB(scope.row)"
                >删除</el-button
              >
            </el-popconfirm>
           
          </template>
        </el-table-column> -->
      </el-table>
    </template>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: {
        imgs: "",
        imgs_up: "",
      },
      deleterid:"",
      imgs_upid: "",
      dialogVisible: false,
      dialogVisible_up: false,

      date: [], //刚进来查询
      inpunt:"", //搜索框
    };
  },
  methods: {
    // 弹窗关闭
    handleClose(done) {
      this.$confirm("确认关闭？")
        .then((_) => {
          done();
        })
        .catch((_) => {});
    },
    // 添加轮播
    addLB() {
      if (this.form.imgs === "") {
        alert("输入不能为空");
        return;
      }
      this.axios
        .get(`/find/rotationadd?r_img=${this.form.imgs}`)
        .then((res) => {
          this.selectUrl();
        });
      this.form.imgs = "";

      this.dialogVisible = false;
    },
    // 搜索
    select() {
      if (this.inpunt==="") {
        this.selectUrl();
      } else {
        this.axios.get(`/user/userselecturl?aid=${this.inpunt}`).then((res) => {
            this.date = res.data.data;
            console.log(res);
          });
      }
    },
    // 查看表单
    selectUrl() {
      this.axios.get("/user/userselect").then((res) => {
        this.date = res.data.data;
        console.log(res);
      });
    },
  },
  mounted: function () {
    this.selectUrl();
  },
};
</script>

<style scoped>
.elinput {
  width: auto;
}
.elinput_btn {
  margin-left: 10px;
}
</style>
